package a1_waittandontify;

import java.util.concurrent.ArrayBlockingQueue;

public class foodie1 extends Thread {
    ArrayBlockingQueue<String> queue;
    public foodie1(ArrayBlockingQueue<String> queue) {
        this.queue = queue;
    }
    @Override
    public void run() {
        while (true) {
            try {
                String s = queue.take();
                System.out.println("吃货吃了一碗" + s);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
